package com.youtellv1.dto;

import lombok.Data;

@Data
public class GSalDTO {
    private Integer sid;
    private Float base_sal;
    private Float subsidy;
    private Float edu;
    private Float full_time;
    private Float phone;
    private Float health;
    private Float safe;
    private Float class_hour;
    private Float parent;
    private Float num;
    private Float year;
    private Float comm;
    private Float post_sal;
    private String month;
    private Integer tid;

    private String tname;
    private String tsex;
    private Integer tage;
    private String tphone;

    public Float getTotalSalary() {
        float classHourBonus = 0;
        if (num != null) {
            if (num < 110) classHourBonus = num * 6;
            else if (num < 150) classHourBonus = num * 7;
            else if (num < 190) classHourBonus = num * 8;
            else if (num < 240) classHourBonus = num * 9;
            else classHourBonus = num * 12;
        }

        return safe + base_sal + subsidy + edu + full_time + phone +
                health + class_hour + parent + year + comm + post_sal + classHourBonus;
    }
}
